package com.splic.product.dto;

import lombok.Data;

import java.util.List;
import java.util.Map;

@Data
public class TranscriptResponse {

    private Metadata metadata;
    private Results results;

    public TranscriptResponse() {
    }

    public Metadata getMetadata() {
        return metadata;
    }

    public void setMetadata(Metadata metadata) {
        this.metadata = metadata;
    }

    public Results getResults() {
        return results;
    }

    public void setResults(Results results) {
        this.results = results;
    }

    @Data
    public static class Metadata {
        private String requestId;
        private String sha256;
        private String created;
        private double duration;
        private int channels;
        private List<String> models;
        private Map<String, ModelInfo> modelInfo;


        @Data
        public static class ModelInfo {
            private String name;
            private String version;
            private String arch;

        }
    }

    @Data
    public static class Results {
        private Channels channels;


        @Data
        public static class Channels {
            private List<Alternative> alternatives;


            @Data
            public static class Alternative {
                private String transcript;
                private double confidence;
                private List<Word> words;
                private Paragraphs paragraphs;


                @Data
                public static class Word {
                    private String word;
                    private double start;
                    private double end;
                    private double confidence;
                    private String punctuatedWord;

                }

                @Data
                public static class Paragraphs {
                    private String transcript;
                    private List<Paragraph> paragraphs;


                    @Data
                    public static class Paragraph {
                        private List<Sentence> sentences;
                        private int numWords;
                        private double start;
                        private double end;


                        @Data
                        public static class Sentence {
                            private String text;
                            private double start;
                            private double end;

                        }
                    }
                }
            }
        }
    }
}
